import { createRouter,createWebHashHistory } from 'vue-router';
import routerPages from './routerPage/pages'

import { routerDocsComponent } from './routerPage/index';

// const router = createRouter({
//     history: createWebHashHistory(),
//     routes:[...routerPages]
// })
// console.log("%c routerPages :",'color:red;font-size:50px', routerPages);

const routes = [
    {
      path: '/',
      name: '主页',
      component: () => import('@/views/index.vue')
    },
    {
      path: '/home',
      name: '组件页面',
      component: () => import('@/views/home.vue'),
      children: routerDocsComponent
    }
  ]

  const router = createRouter({
    history: createWebHashHistory(),
    routes:routes,
    // scrollBehavior(to, from,savedPosition) {
    //   if (to.path !== '/') {
    //     document.querySelector(".app-main").scrollTop = 0;
    //   }
    // }
  });


export default router